package com.ulook.lookplanet.data.repository;

import com.ulook.lookplanet.data.source.SquareDataSource;
import com.ulook.lookplanet.util.net.ResponseCallback;

/**
 * 描述：
 *
 * @author L1998
 * @data 2021/4/6
 */
public class SquareRepository {

    private static volatile SquareRepository instance;
    private SquareDataSource dataSource;

    private SquareRepository(SquareDataSource dataSource){
        this.dataSource = dataSource;
    }

    public static SquareRepository getInstance(SquareDataSource dataSource){
        if(instance == null){
            instance = new SquareRepository(dataSource);
        }
        return instance;
    }

    /**
     * 查询热点话题
     */
    public void queryHotTopics(ResponseCallback callback){
        dataSource.queryHotTopics(callback);
    }

    /**
     * 获取推荐动态
     */
    public void loadData(int currUserId, int itemNum, ResponseCallback callback){
        dataSource.loadData(currUserId, itemNum, callback);
    }

    /**
     * 添加浏览记录
     */
    /*public void addBrowseRecord(int currUserId, String artId, ResponseCallback callback){

    }*/
}
